package org.fengdi.order.feign.client;

import org.fengdi.order.entity.AccountServerRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "account-service")
public interface AccountClient {

    // 检查账户服务是否正常
    @GetMapping("/health")
    String getHealth();

    @PostMapping("/api/account")
    boolean decreaseMoney(@RequestParam("user_id") String userId, @RequestParam("money") double money) throws RuntimeException;
}
